package customview.ike.com.customviewproject.widget.Refresh1.rotationArrow;


import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;

import customview.ike.com.customviewproject.widget.Refresh1.PullAbleView;
import customview.ike.com.customviewproject.widget.Refresh1.Utils;

/**
 * Created by Administrator on 2017/11/28.
 */

public class PullAbleRecycleView extends RecyclerView implements PullAbleView {
    public PullAbleRecycleView(Context context) {
        super(context);
    }

    public PullAbleRecycleView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public PullAbleRecycleView(Context context, @Nullable AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public boolean canPullDown() {
        if (getAdapter()==null){
            return true;
        }
        boolean viewAtBottom = Utils.isViewAtBottom(this);
        if (!viewAtBottom){
            return true;
        }

        return false;
    }

    @Override
    public boolean canPullUp() {
        if (getAdapter()==null){
            return true;
        }
        boolean viewAtBottom = Utils.isViewAtBottom(this);
        if (viewAtBottom){
            return true;
        }

        return false;
    }
}
